import 'package:ysy_flutter_mvvm_yuanxuan/bean/base/BaseBean.dart';

/// 关注 列表
class AttentionPageBean implements BaseJsonBean{
  int? id;
  String? storeId;
  String? storeName;
  String? storeLogo;
  String? introduce;
  int? type;
  int? attentionType;
  List<String>? pic;
  List<ProductDetails>? productDetails;
  int? picSize;
  String? time;
  String? productId;
  String? productName;
  String? productPic;
  double? productPrice;
  String? unit;
  int? isAskPriceFlag;

  AttentionPageBean(
      {this.id,
        this.storeId,
        this.storeName,
        this.storeLogo,
        this.introduce,
        this.type,
        this.attentionType,
        this.pic,
        this.productDetails,
        this.picSize,
        this.time,
        this.productId,
        this.productName,
        this.productPic,
        this.productPrice,
        this.unit,
        this.isAskPriceFlag});

  AttentionPageBean.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    storeId = json['storeId'];
    storeName = json['storeName'];
    storeLogo = json['storeLogo'];
    introduce = json['introduce'];
    type = json['type'];
    attentionType = json['attentionType'];
    pic = json['pic'].cast<String>();
    if (json['productDetails'] != null) {
      productDetails = [];
      json['productDetails'].forEach((v) {
        productDetails?.add(new ProductDetails.fromJson(v));
      });
    }
    picSize = json['picSize'];
    time = json['time'];
    productId = json['productId'];
    productName = json['productName'];
    productPic = json['productPic'];
    productPrice = json['productPrice'];
    unit = json['unit'];
    isAskPriceFlag = json['isAskPriceFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['storeId'] = this.storeId;
    data['storeName'] = this.storeName;
    data['storeLogo'] = this.storeLogo;
    data['introduce'] = this.introduce;
    data['type'] = this.type;
    data['attentionType'] = this.attentionType;
    data['pic'] = this.pic;
    if (this.productDetails != null) {
      data['productDetails'] =
          this.productDetails?.map((v) => v.toJson()).toList();
    }
    data['picSize'] = this.picSize;
    data['time'] = this.time;
    data['productId'] = this.productId;
    data['productName'] = this.productName;
    data['productPic'] = this.productPic;
    data['productPrice'] = this.productPrice;
    data['unit'] = this.unit;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    return data;
  }
}

class ProductDetails {
  String? pic;
  String? productId;

  ProductDetails({this.pic, this.productId});

  ProductDetails.fromJson(Map<String, dynamic> json) {
    pic = json['pic'];
    productId = json['productId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['pic'] = this.pic;
    data['productId'] = this.productId;
    return data;
  }
}

